home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
mcu332
/
332doc.arc
/
332BUGC2
< prev
next >
Wrap
Text File
|
1989-12-19
|
58KB
|
1,721 lines
DEBUG MONITOR USER'S MANUAL MOTOROLA
3-1 M68332BUG
DEBUG MONITOR USER'S MANUAL MOTOROLA
M68332BUG 3-1
LO Load S-Records From Host LO
3.15 LOAD S-RECORDS FROM HOST
LO [<PORT><DEL>][<ADDR>][;<X/-C/T>][=<text>]
Use the LO command to download a Motorola S-records format data file from a host
computer to the BCC. The LO command accepts serial data from the host and loads it into
on-board memory.
The optional port number allows the user to specify the download port. If this number is
omitted, the default is port 0.
The BCC default hardware configuration consists of one I/O port; P4 on the BCC or P9 on the
PFB. This limits the user to one host computer running a terminal emulation program. To
send S-records, the user must escape out of the terminal emulation program because the
host computer can not perform terminal emulation and send S-records at the same time.
When the host is not in terminal emulation mode, all status messages from 332Bug would be
lost. Thus the user must press <CR> twice after re-entering the terminal emulation program
to signal 332Bug that status messages can now be sent.
The optional <ADDR> field allows the user to enter an offset address. This offset address is
added to the address contained in the address field of each record which causes the records
to be stored in memory at a different location. The contents of the automatic offset register
are not added to the S-record addresses (see OF command). If the address is in the range
$0 to $1F and the port number is omitted, enter a comma before the address to distinguish it
from a port number.
The optional text field, entered after the equal sign (=), is sent to the host before 332Bug
begins looking for S-records at the host port. This allows the user to send a download
command to the host device. This text should NOT be delimited by quote marks. The text
string begins immediately following the equal sign and terminates with the carriage return. If
the host is operating full duplex, the string is echoed back to the host port by the host and
appears on the user's terminal screen.
In order to accommodate host systems that echo all received characters, the above-
mentioned text string is transmitted to and received from the host one character at a time.
After the entire command is sent to the host, LO looks for a line feed (LF) character from the
host, signifying the end of the echoed command. No data records are processed until this LF
is received. If the host system does not echo characters, LO continues looking for an LF
character before data records are processed. In situations where the host system does not
echo characters, it is required that the first record transferred by the host system be a header
record. The header record is not used, but the LF after the header record serves to break LO
out of the loop so data records are processed.
LO Load S-Records From Host LO
Other options:
-C - Ignore checksum. A checksum for the data contained within an S-record
is calculated as the S-record is read in through the port. Normally this
calculated checksum is compared to the checksum contained within the
S-record. If the compare fails, an error message is sent to the screen on
completion of the download. If this option is selected, then the
comparison is not made.
X - Echo. As the S-records are read in at the host port, they are echoed to
the user's terminal. Do not use this option when port 0 is specified.
T - TRAP #15 code. This option causes LO to set the target register D4 =
'LO'x, with x = $0C ($4C4F200C). The ASCII string 'LO' indicates that
this is the LO command; the code $0C indicates TRAP #15 support with
stack parameter/result passing and TRAP #15 disk support. This code is
used by the downloaded program to select the appropriate calling
convention when executing debugger functions. Since some Motorola
debuggers use conventions different from 332Bug, they set a different
code in D4.
The S-record format (refer to Appendix A) allows a specified entry point in the address field of
the S-record-block termination record. The contents of the termination-record address field
(plus any offset address) is put into the target PC. Thus after a download the user need only
enter G or GO instead of G <addr> or GO <addr> to execute the downloaded code.
If a non-hex character is encountered within the data field of a data record, then that part of
the record, preceeding the non-hex character, is displayed. This causes the 332Bug error
handler to point at the faulty character.
An error condition exists if the embedded-record checksum does not agree with the
checksum calculated by 332Bug. An output message displays the address of the record (as
obtained from the address field of the record), the calculated checksum, and the checksum
read with the record. A copy of the record is also output. A checksum error is a fatal error and
causes the command to abort.
When a load is in progress, each data byte is written to memory and then the contents of this
memory location are compared to the data to determine if the data is stored properly. If for
some reason the compare fails, then an output message displays the address where the data
was to be stored, the data written, and the data read back during the compare. This is also a
fatal error and causes the command to abort.
S-records are processed character-by-character. So if the command aborts due to an error,
all data stored previous to the error is still in memory .
LO Load S-Records From Host LO
EXAMPLES: Suppose a host computer was used to create a program that looks like this:
1 * Test Program.
2 *
3 65004000 ORG $65004000
4
5 65004000 7001 MOVEQ.L #1,D0
6 65004002 D088 ADD.L A0,D0
7 65004004 4A00 TST.B D0
8 65004006 4E75 RTS
9 END
****** TOTAL ERRORS 0--
****** TOTAL WARNINGS 0--
Then this program was converted into an S-record file named TEST.MX as follows:
S00F00005445535453335337202001015E
S30D650040007001D0884A004E7577
S7056500400055
Load this file into BCC memory for execution at address $4000 as follows:
332Bug>LO -65000000<CR>
(blank line as the BCC waits for an
S-record)
Enter the terminal emulator's escape key to return to the host computer's operating system
(ALT-F4 for ProComm). A host command is then entered to send the S-record file to the port
where the BCC is connected (for MS-DOS based host computer this would be "type test.mx
>com1", where the BCC was connected to the com1 port).
After the file has been sent, the user then restarts the terminal emulation program (for MS-
DOS based host computers, enter EXIT at the prompt).
Since the port number equals the current terminal, two <CR>'s are required to signal 332Bug
that the download is complete and the terminal emulation program is ready to receive any
error messages.
<CR><CR> (signal download completion)
332> (no error messages)
MA Macro Define/Display MA
NOMA Macro Delete NOMA
3.16 MACRO DEFINE/DISPLAY/DELETE
MA [<NAME>]
NOMA [<NAME>]
The <NAME> can be any combination of 1-8 alphanumeric characters.
The MA command allows the user to define a complex command consisting of any number of
332Bug primitive commands with optional parameter specifications. By simply entering the
new <NAME> plus any arguments on the command line, the stored 332Bug commands are
executed. This allows the user to design new commands to simplify the debug process. The
NOMA command is used to delete either a single macro or all macros.
Entering MA without specifying a macro name causes 332Bug to list all currently defined
macros and their definitions.
When MA is executed with the name of a currently defined macro, that macro definition is
displayed.
Line numbers are shown when displaying macro definitions to facilitate editing via the macro
edit (MAE) command. If MA is executed with a valid name that does not currently have a
definition, then the 332Bug enters the macro definition mode. In response to each macro
definition prompt "M=", enter a 332Bug command and a carriage return. Commands entered
are not checked for syntax until the macro is executed. To exit the macro definition mode,
enter only a carriage return (null line) in response to the prompt. If the macro contains errors,
it can either be deleted and redefined or it can be edited with the MAE command. A macro
containing no primitive 332Bug commands (i.e., no definition) is not accepted.
Macro definitions are stored in a string pool of fixed size. If the string pool becomes full while
in the definition mode, the offending string is discarded, a message STRING POOL FULL,
LAST LINE DISCARDED is printed and the user is returned to the 332Bug command prompt.
This also happens if the string entered would cause the string pool to overflow. The string
pool has a capacity of 511 characters. The only way to add or expand macros when the
string pool is full is to either edit or delete macros.
332Bug commands contained in macros may reference arguments supplied at invocation
time. Arguments are denoted in macro definitions by embedding a back slash (\) followed by
a numerial. As many as ten arguments are permitted. A definition containing a back slash
followed by a zero would cause the first argument to that macro to be inserted in place of the
"\0" characters.
MA Macro Define/Display MA
NOMA Macro Delete NOMA
The second argument is used whenever the sequence "\1" occurs. Entering ARGUE 3000 1
;B on the debugger command line would execute the macro named ARGUE with the text
strings 3000, 1, and ;B replacing "\0", "\1", and "\2", respectively, within the body of the macro.
To delete a macro, execute NOMA followed by the name of the macro. Executing NOMA
without specifying a macro name deletes all macros. If NOMA is executed with a valid macro
name that does not have a definition, an error message is printed.
EXAMPLES:
332Bug>MA ABC<CR> Define macro ABC
M=MD 3000
M=GO \0
M=<CR>
332Bug>
332Bug>MA DASM<CR> Define macro DASM
M=MD \0:5;DI
M=<CR>
332Bug>
332Bug>MA<CR> List macro definitions
MACRO ABC
010 MD 3000
020 GO \0
MACRO DIS
010 MD \0:5;DI
332Bug>
332Bug>DASM 427C<CR> Execute DASM macro.
0000427C 48E78080 MOVEM.L D0/A0,-(A7)
00004280 4280 CLR.L D0
00004282 1018 MOVE.B (A0)+,D0
00004284 5340 SUBQ.W #$1,D0
00004286 12D8 MOVE.B (A0)+,(A1)+
332Bug>
332Bug>MA ABC<CR> List definitions macro ABC
MACRO ABC
010 MD 3000
020 GO \0
332Bug>
332Bug>NOMA DASM<CR> Delete macro DASM
332Bug>
MA Macro Define/Display MA
NOMA Macro Delete NOMA
332Bug>MA ASM<CR> Define macro ASM
M=MM \0;DI
M=<CR>
332Bug>
332Bug>MA<CR> List all macros
MACRO ABC
010 MD 3000
020 GO \0
MACRO ASM
010 MD \0;DI
332Bug>
332Bug>NOMA<CR> Delete all macros
332Bug>
332Bug>MA<CR> List all macros
NO MACROS DEFINED
332Bug>
MAE Macro Edit MAE
3.17 MACRO EDIT
MAE <NAME><DEL><LINE#><DEL>[<STRING>]
Where:
<NAME> any combination of 1-8 alphanumeric characters
<LINE#> line number in range 1-999
<STRING> replacement line to be inserted
The MAE command permits modification of the macro named on the command line. MAE is
line oriented and supports the following actions: insertion, deletion, and replacement.
To insert a line, specify a line number between the numbers of the lines that the new line is to
be inserted between. The text of the new line to be inserted must also be specified on the
command line following the line number.
To replace a line, specify its line number and enter the replacement text after the line number
on the command line.
A line is deleted if its line number is specified and the replacement line is omitted.
Attempting to delete a nonexistent line results in an error message being printed. MAE does
not permit deletion of a line if the macro consists of only that line. NOMA must be used to
remove a macro. To define new macros, use MA; the MAE command operates only on
previously defined macros.
Line numbers serve one purpose: specifying the location within a macro definition to perform
the editing function. After the editing is complete, the macro definition is displayed with a new
set of line numbers.
EXAMPLES:
332Bug>MA<CR> List definitions of macro ABC
MACRO ABC
010 MD 3000
020 GO \0
332Bug>
332Bug>MAE ABC 15 RD<CR> Add a line to macro ABC
MACRO ABC
010 MD 3000
020 RD This line was inserted
030 GO \0
332Bug>
MAE Macro Edit MAE
332Bug>MAE ABC 10 MD 10+R0<CR> Replace line 10
MACRO ABC
010 MD 10+R0 This line was overwritten
020 RD
030 GO \0
332Bug>
332Bug>MAE ABC 30<CR> Delete line 30
MACRO ABC
010 MD 10+R0
020 RD
332Bug>
MAL Macro Expansion Listing Enable MAL
NOMAL Macro Expansion Listing Disable NOMAL
3.18 MACRO EXPANSION LISTING ENABLE/DISABLE
The MAL command allows the user to view expanded macro lines as they are executed.
This is especially useful when errors result, as the line with the error appears on the display.
The NOMAL command is used to suppress the listing of macro lines during execution.
The use of MAL and NOMAL is a convenience for the user and in no way interacts with the
function of the macros.
MD Memory Display MD
3.19 MEMORY DISPLAY
MD[S] <ADDR>[:<COUNT>|<ADDR>][; [B|W|L|S|D|X|P|DI]]
Use the MD command to display the contents of multiple memory locations. MD accepts the
following data types:
Integer Data Type Floating Point Data Types
B - Byte S - Single Precision
W - Word D - Double Precision
L - Longword X - Extended Precision
P - Packed Decimal
The default data type is word (W). Integer data types are always displayed in both hex and
ASCII. The DI option enables the resident MC68332 disassembler. No other option is
allowed if DI is selected.
The optional count argument in the MD command specifies the number of data items to be
displayed, or the number of disassembled instructions to display if the disassembly option is
selected. The default is 8 if no value for <COUNT> is entered. The default count is changed
to 128 if the S (sector) modifier is used. After the command has completed, enter <CR> at
the prompt to re-execute the command and display the same number of lines of data
beginning at the next address.
EXAMPLE 1:
332Bug>md C000<CR>
0000C000 2800 1942 2900 1942 2800 1842 2900 2846 (..B)..B(..B).(F
332Bug><CR>
0000C010 FC20 0050 ED07 9F61 FF00 000A E860 F060 1..Pm..a....h'p'
EXAMPLE 2: Assume the following processor state: A2=00003500, D5=00000127.
332Bug>md (a2,d5):&19;b<CR>
00003627 4F82 00C5 9B10 337A DF01 6C3D 4B50 0F0F 0..E..3z_.l=KP..
00003637 31AB 80 1+.
332Bug>
MD Memory Display MD
EXAMPLE 3:
332Bug>md 5008;di<CR>
00005008 46FC2700 MOVE.W #$2700,SR
0000500C 61FF0000023E BSR.L #$524C
00005012 4E7AD801 MOVEC.L VBR,A5
00005016 41ED7FFC LEA.L $7FFC(A5),A0
0000501A 5888 ADDQ.L #$4,A0
0000501C 2E48 MOVE.L A0,A7
0000501E 2C48 MOVE.L A0,A6
00005020 13C7FFFB003A MOVE.B D7,($FFFB003A).L
332Bug>
EXAMPLE 4:
332Bug>md 5008;d<CR>
00005000 0 3F6 44C1D0F047FC2= 2.4777000000000002 E-0003
00005008 0 423 DAEFF04800000= 1.2749000000000000 E+0011
00005010 0 000 0000000000000= 0.0000000000000000 E+0000
00005018 0 403 0000000000000= 1.6000000000000000 E+0001
00005020 0 3FF 0000000000000= 1.0000000000000000 E+0000
00005028 0 000 00000FFFFFFFF= 2.1219957904712067 E+0314
00005030 0 44D FDE9F10A8D361= 6.0200000000000000 E+0023
00005038 0 3C0 79CA10C924223= 1.5999999999999999 E+0019
332Bug>
NOTE
If the address location requested is not displayed, the automatic offset register is
non-zero and has been added to the address. See the offset (OF) command.
MM Memory Modify MM
3.20 MEMORY MODIFY
MM <ADDR>[;[[B|W|L|S|D|X|P][A][N]]|[DI]]
Use the MM command (alias M) to examine and change memory locations. MM accepts the
following data types:
INTEGER DATA TYPE FLOATING POINT DATA TYPES
B - Byte S - Single Precision
W - Word D - Double Precision
L - Longword X - Extended Precision
P - Packed Decimal
The default data type is word. The MM command (alias M) reads and displays the contents
of memory at the specified address and prompts the user with a question mark ( ? ). The user
may enter new data for the memory location, followed by <CR>, or may simply enter <CR>,
which leaves the contents unaltered. That memory location is closed and the next memory
location is opened.
The user may also enter one of several step control characters, either at the prompt or after
writing new data. Enter one of the following step control characters to modify the command
execution:
V or v - The next successive memory location is opened. This is the default. It
initializes whenever MM is executed and remains initialized until changed
by entering one of the other special characters.
^ - MM backs up and opens the previous memory location.
= - MM re-opens the same memory location. This is useful for examining I/O
registers or memory locations that are changing over time).
. - Terminates MM command. Control returns to 332Bug.
The N option of the MM command disables the read portion of the command. The A option
forces alternate location accesses only, i.e. skip a byte/word/longword access per the data
type in use.
NOTE
If the address location requested is not displayed, the automatic offset register is
non-zero and has been added to the address. See the offset (OF) command.
MM Memory Modify MM
EXAMPLE 1:
332Bug>MM 3100<CR> Access location 3100
00003100 1234?<CR>
00003102 5678? 4321<CR> Modify memory
00003104 9ABC? 8765^<CR> Modify memory and backup
00003102 4321?<CR> No change, backup still utilized
00003100 1234? abcd.<CR> Modify memory and exit
EXAMPLE 2:
332Bug>MM 3001;LA<CR> Longword access to location 3001
00003001 CD432187?<CR> (Alternate location accesses)
00003009 00068010? 68010+10=<CR> Modify and re-open location
00003009 00068020?<CR> No change, re-open still utilized
00003009 00068020? .<CR> Exit MM
EXAMPLE 3:
332Bug>MM 4000<CR> Modify WORDs starting at $4000.
00004000 0000? 'A'<CR> Enter ASCII 'A', right justified.
00004002 0000? 'B'<CR> Enter ASCII 'B', right justified.
00004004 0000? 'CD'<CR> Enter ASCII 'CD', right justified.
00004006 0000? 'EFG'<CR> Enter ASCII 'FG', right justified.
Note the 'E' is truncated due to
right justified WORD size!
00004008 0000? .<CR> Exit MM.
332Bug>MD 4000<CR>
00004008 0041 0042 4344 4647 0000 0000 0000 0000 .A.BCDFG........
332Bug>
The DI option activates the one-line assembler/disassembler. All other options are invalid if
DI is selected. The contents of the specified memory location is disassembled and displayed
and the user prompted for an input with a question mark ( ? ). At this point the user has three
options:
Ñ Enter <CR> - This closes the present location and continues with disassembly of
the next instruction. The instruction is unchanged.
Ñ Enter a new source instruction followed by <CR> - This actuates the assembler to
assemble the new instruction and generate a disassembly of the object code
generated.
Ñ Enter <CR> - This closes the present location and exits the MM command.
If a new source line is entered (second option above), the present line is erased and
replaced by the new source line. If a hardcopy terminal is used, reconfigure port 0 for
hardcopy operation with the PF command. In the hardcopy mode, a line feed is entered
instead of erasing the line.
MM Memory Modify MM
If an error is found during assembly, the caret symbol (^) appears below the suspect field
followed by an error message. The accessed location is redisplayed.
Refer to Chapter 4 for additional information about the assembler.
The examples below were made in the hardcopy mode.
EXAMPLE 3:
Assemble a new source line.
332Bug>MM 10000;di<CR>
00010000 46FC2400 MOVE.W #9216,SR ? divs.w -(a2),d2<CR>
00010000 85E2 DIVS.W -(A2),D2
00010002 2400 MOVE.L D0,D2 ?.<CR>
EXAMPLE 4:
New source line with error.
332Bug>MM 10008;di<CR>
00010008 4E7AD801 MOVEC.L VBR,A5? bchg #$12,9(a5,d6))<CR>
00010008 BCHG #$12,9(A5,D6))
---------------------------------------------------^
*** Unknown Field ***
00010008 4E7AD801 MOVEC>L VBR,A5 ?.<CR>
EXAMPLE 5:
Step to next location and exit MM.
332Bug>MM 1000c;di<CR>
0001000C 000000FF OR.B #255,D0 ?<CR>
00010010 20C9 MOVE.L A1,(A0)+ ? .<CR>
332Bug>
EXAMPLE 6:
332Bug>m 7000;x<CR>
00007000 0 0000 FFFFFFFF00000000? 1 3C10 84782<CR>
0000700C 1 7FFF 00000000FFFFFFFF? 0 001A F<CR>
00007018 0 0000 FFFFFFFF00000000? 6.02E23=<CR>
00007018 0 404D FEF4F885469B0880? ^<CR>
0000700C 0 001A F000000000000000?<CR>
00007000 1 3C10 8478200000000000? .<CR>
332Bug>
MS Memory Set MS
3.21 MEMORY SET
MS <ADDR>{Hexadecimal number}/{'string'}
Use the MS command to write data to memory starting at a specified address. Hex numbers
are not size specific, so they can contain any number of digits (as allowed by command line
buffer size). If an odd number of digits is entered, the least significant nibble of the last byte
accessed is unchanged.
ASCII strings are entered by enclosing them in single quotes ('string'). To include a quote as
part of the string, enter two consecutive quotes.
EXAMPLE: Memory is initially cleared:
332Bug>ms 25000 0123456789abcDEF 'This is ''332Bug''' 23456<CR>
332Bug>md 25000:10;w<CR>
00025000 0123 4567 89AB CDEF 5468 6973 2069 7320 .#Eg.+MoThis is
00025010 2733 3332 4275 6727 2345 6000 0000 0000 '332Bug'#E`.....
332Bug>
NOTE
If the address location requested is not displayed, the automatic offset register is
non-zero and has been added to the address. See the offset (OF) command.
OF Offset Registers Display/Modify OF
3.22 OFFSET REGISTERS DISPLAY/MODIFY
OF [Rn[;A]]
The OF command allows the user to access and change pseudo-registers called offset
registers. These registers are used to simplify the debugging of relocatable and position
independent modules (refer to offset registers in paragraph 2.1.1.3).
There are 8 offset registers (R0 through R7), but only R0 through R6 can be changed. Both
the base and top addresses of R7 is always set to 0. This disables the automatic register
function by selecting R7 as the automatic register.
Each offset register has two values: base and top. The base is the absolute least address
used for the range declared by the offset register. The top address is the absolute greatest
address used. When entering the base and top, the user may use either an address/address
format or an address/count format. When specifying a count the value of count is in bytes. If
the top address is omitted from the range, then a top address of $FFFFFFFF is the default.
The top address must equal or exceed the base address. Wrap-around is not permitted.
Command usage:
OF - Display all offset registers. An asterisk indicates which register is
the automatic register.
OF Rn - Display/modify Rn. Scroll through the registers using the same
method as the MM command.
OF Rn;A - Display/modify Rn and set it as the automatic register. The
automatic register is added to the absolute address argument of
every command except if an offset register is explicitly added. in
the display an asterisk indicates which register is the automatic
register.
Range entry:
Ranges are entered in three formats; base address alone, base and top as a
pair of addresses, and base address followed by byte count. Step control
characters as described in the MM (memory modify) command are supported.
Range syntax:
[<base address> [<del> <top address>] ] [^|v|=|.]
or
[<base address> [ : <byte count> ] ] [^|v|=|.]
OF Offset Registers Display/Modify OF
Offset register rules:
Ñ At power-up and cold-start reset, R7 is the automatic register, and all offset
registers have both base and top addresses preset to 0. This disables the
offset registers.
Ñ R7 always has both base and top addresses set to 0; it cannot be changed.
Ñ Any offset register can be set as the automatic register.
Ñ The automatic register is always added to every absolute address argument of
every 332Bug command where an offset register is not explicitly defined (this
includes the OF command itself). To enter an absolute address, always add
R7 to the address, i.e. +R7.
Ñ The register commands (RD, RM) do not use the automatic register, i.e. the
program counter is always displayed/entered absolutely. However, the RS
(register set) command does use the automatic register.
Ñ There is always an automatic register. To disable the effect of the automatic
register set R7 as the automatic register. This is the default condition.
EXAMPLES: Display offset registers. Shows base and top values for each
register.
332Bug>OF<CR>
R0 = 00000000 00000000 R1 = 00000000 00000000
R2 = 00000000 00000000 R3 = 00000000 00000000
R4 = 00000000 00000000 R5 = 00000000 00000000
R6 = 00000000 00000000 R7*= 00000000 00000000
Modify offset registers.
332Bug>OF R0<CR>
R0 = 00000000 00000000? 5000 50FF<CR>
R1 = 00000000 00000000? 5100:200^<CR> Modify and backup
R0 = 00020000 000200FF? <CR> No change, backup still
utilized
R6 = 00000000 00000000? .<CR> Exit. Notice wrap around
to R6.
Display location $5000. Shows base and top values for each register.
332Bug>M 5000;DI<CR>
00000+R0 41F95445 5354 LEA.L ($54455354).L,A0 .<CR>
332Bug>M R0;DI <CR>
00000+R0 41F95445 5354 LEA.L ($54455354).L,A0 .<CR>
332Bug>
OF Offset Registers Display/Modify OF
Set R0 as the automatic register.
332Bug>OF R0;A<CR>
R0*=00005000 000050FF? .<CR>
Display location 0 relative to the default offset register, (R0), i.e. absolute location $5000.
332Bug>M 0;DI<CR>
00000+R0 41F95445 5354 LEA.L ($54455354).L,A0 .<CR>
332Bug>
Display absolute location 0, override the automatic offset.
332Bug>M 0+R7;DI <CR>
00000000 FFF8 DC.W $FFF8 .<CR>
332Bug>
PA Printer Attached PA
NOPA Printer Detached NOPA
3.23 PRINTER ATTACH/DETACH
PA [<PORT>]
NOPA [<PORT>]
PA attach a printer to a specified port. NOPA detaches a printer from a specified port. When
the printer is attached, everything appearing on the computer terminal is echoed to the
attached printer. If no port is specified when executing PA, the default is port 1. NOPA
detaches all attached printers. The port number must be in the range 0 to $1F.
If the port number specified is not currently assigned, PA displays an error message. If
NOPA is attempted on a printer that is not currently attached, an error message is displayed.
Use the PF (port format) command to configure the port before attaching a printer to it.
RECOVERING FROM A ''HUNG''PRINTER: attached ports are not detached by exceptions
(bus errors, abort, etc). If PA is executed using incorrect parameters, or a fault such as a
paper jam occurs, press the RESET switch on the M68332PFB Platform Board to recover
control of the printer.
EXAMPLES:
CONSOLE DISPLAY: PRINTER OUTPUT:
332Bug>PA <CR>
(attaching port 1 by default (printer now attached)
332Bug>HE NOPA <CR> 332Bug>HE NOPA
NOPA Printer detach NOPA Printer detach
332Bug>NOPA <CR> 332Bug>NOPA
(detach all attached printers) (printer now detached)
332Bug>
PF Port Format PF
3.24 PORT FORMAT
PF [<PORT>]
Use the PF command to display and change the serial input/output environment. Use PF to
display a list of the current port assignments, configure a port that is already assigned, or
assign and configure a new port. The configuration process is interactive, much like
modifying registers or memory (RM and MM commands). An interlock is provided prior to
configuring the hardware, the user must explicitly direct PF to proceed.
Only eight ports are assigned at any given time. The port number must be within the range 0
to $1F.
3.24.1 List Current Port Assignments
Executing PF without specifying a port number lists the board and port names.
EXAMPLE:
332Bug>PF <CR>
Current port assignments: (Port #: Board name, Port name)
00: BCC, "SCI"
332Bug>
3.24.2 Port Configuration
Use PF to primarily change baud rates, stop bits, etc. Execute the PF command with the
desired port number to assign and configure port parameters. Refer to paragraph 3.20.4
New Port Assignment.
When PF is executed with the number of a previously assigned port, the interactive mode is
entered immediately. To exit from the interactive mode, enter a period by itself or following a
new value/setting. While in the interactive mode, step control characters as described in the
MM (memory modify) command are supported.
EXAMPLE: Change number of stop bits on port number 0.
332Bug>PF 0 <CR>
Baud rate [110,300,600,1200,2400,4800,9600,19200] = 9600? <CR>
Even, Odd, or No Parity [E,O,N] = N? <CR>
Char Width [5,6,7,8] = 8? <CR>
Stop bits [1,2] = 1? 2<CR> (new value entered)
PF Port Format PF
( the next response demonstrates reversing the prompting order )
XON/XOFF protocol [Y,N] = Y? ^ <CR> (Backup)
Stop Bits [1,2] = 2? .<CR> (value acceptable, exit
interactive mode)
OK to proceed (y/n)? Y (Note: Carriage return not
required)
332Bug>
3.24.3 Port Format Parameters
Port base address:
When assigning a port, there is a set base address option. This allows the user to
adjust the base address for different hardware configurations. Entering no value
selects the default address.
Baud rate:
Select the baud rate: 110, 300, 600, 1200, 2400, 4800, 9600, 19200.
Parity type:
Set parity: even (E), odd (0), or disabled (N).
Character width:
Select 5-, 6-, 7-, or 8-bit characters.
Number of stop bits:
Only 1 and 2 stop bits are supported.
Automatic software handshake:
Current drivers have the capability of responding to XON/XOFF characters sent to the
debugger ports. Receiving a XOFF causes a driver to cease transmission until a XON
character is received. None of the current drivers utilize FIFO buffering, therefore,
none initiate an XOFF condition.
Software handshake character values:
The values used by a port for XON and XOFF may be defined as any 8-bit value. ASCII
control characters or hexadecimal values are accepted.
PF Port Format PF
NOTE
Not all combinations of parity type, character width, and stop bits
are supported for the BCC "SCI" port, 00. See Appendix C for
details.
3.24.4 New Port Assignment
PF supports a set of drivers for a number of different boards and ports. To assign one of
these to a previously unassigned port number, execute the command with that port number.
A message is then printed to indicate that the port is unassigned and a prompt issued to
request the type of serial communication device. Pressing RETURN at this point lists the
currently supported boards and ports. Once the name of the board is entered, the port name
is requested at the prompt. After the port name is entered, PF prompts the user through the
port configuration process.
Once a valid port is specified, default parameters are supplied. The base address of this new
port is one of these default parameters. Before entering the interactive configuration mode,
the user is allowed to change the port base address. Press RETURN to retain the present
base address.
If the configuration of the new port is not fixed, then the system enters the interactive
configuration mode. Refer to paragraph 3.20.2 regarding configuring assigned ports. If the
new port has a fixed configuration, then PF issues the ''OK to proceed (Y/N)?'' prompt.
The user must enter the letter ''Y'' at the ''OK to proceed (Y/N)?'' prompt before PF initializes
the hardware. Pressing BREAK any time prior to this step or responding with the letter ''N''
at the prompt leaves the port unassigned. This is only true of ports not previously assigned.
EXAMPLE: Assigning port 1.
332Bug>PF 1<CR>
Logical unit $01 unassigned
Name of board?<CR> (cause PF to list supported boards,
ports)
Boards and ports supported:
BCC: SCI
MC68681: A, B
Name of board? mc68681<CR> (Note: Upper or lowercase accepted)
Name of port? a<CR>
Port base address = $FFFFE000?<CR>
Baud rate [110, 300, 600, 1200, 2400, 4800, 9600, 19200] = 9600? .<CR>
OK to proceed (Y/N)? n (Note: Aborted, no hardware!)
332Bug>
RD Register Display RD
3.25 REGISTER DISPLAY
RD {[+|-|=][<DNAME>][/]}{[+|-|=][<REG1>[-<REG2>]][/]}
Use the RD command to display the target state, that is, the register state associated with the
target program (refer to the GO command). The target PC points to the instruction to be
disassembled and displayed. Internally, a register mask specifies which registers are
displayed when RD <CR> is executed. At reset time, this mask is set to display the MPU
registers only. Change this register mask with the RD command. Optional arguments allow
the user the capability to enable or disable the display of any register or group or registers.
This is useful for showing only the registers of interest, minimizing unnecessary data on the
screen.
The arguments are:
+ Add a device or register range
- Remove a device or register range, except when used between two
register names. In which case it indicates a register range.
= Set a device or register range.
/ Use this delimiter between device names and register ranges.
<REG1> Indicates the first register in a range of registers.
<REG2> Indicates the last register in a range of registers.
<DNAME> Indicates a device name. Use <DNAME> to enable or disable all
device registers for:
MPU Microprocessor Unit
RD Register Display RD
Observe the following when specifying any arguments in the command line:
Ñ The qualifier is applied to the next register range only.
Ñ If no qualifier is specified, a + qualifier is assumed.
Ñ All device names should precede register names.
Ñ The command line arguments are parsed from left to right, with each field
being processed after parsing, thus, the sequence in which qualifiers and
registers are organized has an impact on the resultant register mask.
Ñ When specifying a register range, <REG1> and <REG2> do not have to be of
the same class, i.e. D0 - A7.
Ñ The register mask used by RD is also used by all the exception handler
routines, including the trace and breakpoint exception handlers.
The MPU registers in ordering sequence are:
Number of
registers
10 System Registers (PC,SR,USP,SSP,VBR,SFC,DFC)
8 Data Registers (D0-D7)
8 Address Registers (A0-A7)
RD Register Display RD
EXAMPLE 1:
332Bug>rd<CR>
PC =00003000 SR =2700=TR:OFF_S_7_..... VBR =00000000
SFC =0=F0 DFC =0=F0 USP =0000F830 SSP* =00004000
D0 =00000000 D1 =00000000 D2 =00000000 D3 =00000000
D4 =00000000 D5 =00000000 D6 =00000000 D7 =00000000
A0 =00000000 A1 =00000000 A2 =00000000 A3 =00000000
A4 =00000000 A5 =00000000 A6 =00000000 A7 =00004000
00003000 424F DC.W $424F
332Bug>
NOTES:
An asterisk following a stack pointer name indicates an active stack pointer. To
facilitate reading the status register it includes a mnemonic portion. These
mnemonics are:
Trace Bits The trace bits (T0, T1) control the trace feature of the MC68332
MCU and are displayed by the mnemonic as shown in the
following table. The user should not modify these bits when
executing user programs.
T1 T0 Mnemonic Description
0 0 TR:OFF Trace off
0 1 TR:CHG Trace on change of flow
1 0 TR:ALL Trace all states
1 1 TR:INV Invalid mode
S Bits: The bit name (S) appears if the supervisor/user state bit is set,
otherwise a period (.) indicates it is cleared.
Interrupt Mask: A number from 0 to 7 indicates the current processor priority level.
Condition Codes: The bit name (X, N, Z, V, C) appears if the respective bit is set,
otherwise a period (.) indicates it is cleared.
RD Register Display RD
The source and destination function code registers (SFC, DFC) include a two character
mnemonic:
FUNCTION CODE MNEMONIC DESCRIPTION
0 F0 Undefined
1 UD User Data
2 UP User Program
3 F3 Undefined
4 F4 Undefined
5 SD Supervisor Data
6 SP Supervisor Program
7 CS CPU Space
EXAMPLE 2: To set the display to D6 and A3 only.
332Bug>RD =D6/A3<CR>
D6 =00000000 A3 =00000000
00003000 4AFC ILLEGAL
332Bug>
Note that the above sequence sets the display to D6 only and then adds register A3 to the
display.
EXAMPLE 3: To restore all the MPU registers.
332Bug>rd +mpu<CR>
PC =00003000 SR =2700=TR:OFF_S_7_..... VBR =00000000
SFC =0=F0 DFC =0=F0 USP =00003830 SSP* =00004000
D0 =00000000 D1 =00000000 D2 =00000000 D3 =00000000
D4 =00000000 D5 =00000000 D6 =00000000 D7 =00000000
A0 =00000000 A1 =00000000 A2 =00000000 A3 =00000000
A4 =00000000 A5 =00000000 A6 =00000000 A7 =00004000
00003000 4AFC ILLEGAL
332Bug>
Note that an equivalent command is ''RD +PC-A7'' or ''RD =PC-A7''.
RESET Cold/Warm Reset RESET
3.26 COLD/WARM RESET
RESET
Use the RESET command to specify the reset operation level when a RESET exception is
detected by the processor. Press the RESET pushbutton on the M68332PFB platform board
to generate a reset exception.
Two RESET levels are available:
COLD - This is the standard mode of operation, and is the default at power-
up. In this mode all the static variables are initialized every time a
reset is executed.
WARM - In this mode all the static variables are preserved when a reset
exception occurs. This is convenient for keeping breakpoints, offset
register values, the target register state, and any other static
variables in the system.
EXAMPLE:
332Bug>RESET<CR>
Cold/Warm Start = C (C/W)? W Set to warm start
332Bug>
Press the RESET pushbutton
332Bug Debugger/Diagnostics - Version 1.01
(C) Copyright 1989 by Motorola Inc.
Warm Start
332Bug>
RM Register Modify RM
3.27 REGISTER MODIFY
RM <REG>
Use the RM command to display and change the target registers. The RM command
functions in essentially the same way as the MM command, and the same step control
characters are used to control the display/change session. Refer to the MM command.
EXAMPLE 1:
332Bug>RM D4<CR>
D5 =12345678? ABCDEF^<CR> Modify register and backup
D4 =00000000? 3000.<CR> Modify register and exit
332Bug>
EXAMPLE 2:
332Bug>rm sfc<CR>
SFC =7=CS ? 1=<CR> Modify register and re-open
SFC =1=UD ? .<CR> Exit
332Bug>
RS Register Set RS
3.28 REGISTER SET
RS <REG>[<EXP>][;A]
Use the RS command to display or change a single target register. The default offset register
value is always added to <EXP> unless overridden by specifically including an offset register.
See the OF (offset register) command.
The ;A option is only valid when <REG> is an offset register, i.e. R0 - R7. Use the ;A option to
set <REG> as the automatic register. If R7 is specified, no <EXP> is allowed (R7 cannot be
changed). See the OF (offset register) command.
EXAMPLE 1:
332Bug>RS PC 40*1000+4<CR>
PC =00040004
332Bug>
EXAMPLE 2:
332Bug>OF R4;A<CR>
R4*00000000 00000000? 4000 4FFF<CR> Set up automatic offset register
R4.
332Bug>RS PC 124<CR>
PC =00004124 Set PC=$124+R4.
332Bug>RS A4 32A<CR>
A4 =0000432A Set A4=$32A+R4.
332Bug>RS A5 400+R7<CR>
A5 =00000400 Set A5 equal to absolute
location $400 ($400+R7).
332Bug>
SD Switch Directories SD
3.29 SWITCH DIRECTORIES
SD
Use the SD command to toggle between the debugger directory and the diagnostic directory.
Use the HE (Help) command to list the current directory commands.
Directory structure allows access to the debugger commands from either directory but the
diagnostic commands are only available from the diagnostic directory.
EXAMPLE 1:
332Bug>SD<CR>
332Diag> ( The user has changed from the debugger )
( directory to the diagnostic directory, )
( as can be seen by the ''332Diag>'' )
( prompt )
EXAMPLE 2:
332Diag>SD<CR>
332Bug> ( The user is now back in the debugger )
( directory. )
T Trace T
3.30 TRACE
T [<COUNT>]
Use the T command to execute one instruction at a time and display the target state after
execution. T starts tracing at the address in the target PC. The optional count field specifies
the number of instructions to be traced before returning control to 332Bug. The count field
default is 1. As each instruction is traced, a register display printout is generated.
During tracing, breakpoints in ROM or write protected memory are monitored (but not
inserted) for all trace commands which allow the use of breakpoints in ROM or write protected
memory. Control is returned to 332Bug if a breakpoint with 0 count is encountered.
Trace functions are implemented with the trace bits (T0, T1) in the MC68332 MCU device
status register. Do not modify trace bits (T0, T1) while using the trace commands. Because
the trace functions are implemented using the hardware trace bits in the MC68332 MCU,
code in ROM can be traced. During trace mode, breakpoints are monitored and their counts
decremented when the corresponding instruction with breakpoint is traced. This allows
breakpoints to work in ROM, but only in the trace mode.
EXAMPLE: (The following program resides at location $7000)
332Bug>MD 7000;DI<CR>
00007000 2200 MOVE.L D0,D1
00007002 4282 CLR.L D2
00007004 D401 ADD.B D1,D2
00007006 E289 LSR.L #$1,D1
00007008 66FA BNE.B $7004
0000700A E20A LSR.B #$1,D2
0000700C 55C2 SCS.B D2
0000700E 60FE BRA.B $700E
332Bug>
Initialize PC and D0:
332Bug>RM PC<CR>
PC =00008000 ? 7000.<CR>
332Bug>RM D0 <CR>
D0 =00000000 ? 8F4IC.<CR>
T Trace T
Display target registers and trace one instruction:
332Bug>RD<CR>
PC =00007000 SR =2700=TR:OFF_S_7_..... VBR =00000000
SFC =0=F0 DFC =0=F0 USP =0000382C SSP* =00004000
D0 =0008F41C D1 =00000000 D2 =002003A2 D3 =00000000
D4 =00000000 D5 =00000000 D6 =00000000 D7 =00000000
A0 =00000000 A1 =00000000 A2 =00000000 A3 =00000000
A4 =00000000 A5 =00000000 A6 =00000000 A7 =00004000
00007000 2200 MOVE.L D0,D1
332Bug>T<CR>
PC =00007002 SR =2700=TR:OFF_S_7_..... VBR =00000000
SFC =0=F0 DFC =0=F0 USP =0000382C SSP* =00004000
D0 =0008F41C D1 =0008F41C D2 =002003A2 D3 =00000000
D4 =00000000 D5 =00000000 D6 =00000000 D7 =00000000
A0 =00000000 A1 =00000000 A2 =00000000 A3 =00000000
A4 =00000000 A5 =00000000 A6 =00000000 A7 =00004000
00007002 4282 CLR.L D2
332Bug>
Trace next instruction:
332Bug><CR>
PC =00007004 SR =2704=TR:OFF_S_7_..Z.. VBR =00000000
SFC =0=F0 DFC =0=F0 USP =0000382C SSP* =00004000
D0 =0008F41C D1 =0008F41C D2 =00000000 D3 =00000000
D4 =00000000 D5 =00000000 D6 =00000000 D7 =00000000
A0 =00000000 A1 =00000000 A2 =00000000 A3 =00000000
A4 =00000000 A5 =00000000 A6 =00000000 A7 =00004000
00007004 D401 ADD.B D1,D2
332Bug>
T Trace T
Trace the next two instructions:
332Bug>T 2<CR>
PC =00007006 SR =2700=TR:OFF_S_7_..... VBR =00000000
SFC =0=F0 DFC =0=F0 USP =0000382C SSP* =00004000
D0 =0008F41C D1 =0008F41C D2 =0000001C D3 =00000000
D4 =00000000 D5 =00000000 D6 =00000000 D7 =00000000
A0 =00000000 A1 =00000000 A2 =00000000 A3 =00000000
A4 =00000000 A5 =00000000 A6 =00000000 A7 =00004000
00007006 E289 LSR.L #$1,D1
PC =00007008 SR =2700=TR:OFF_S_7_ ..... VBR =00000000
SFC =0=F0 DFC =0=F0 USP =0000382C SSP* =00004000
D0 =0008F41C D1 =00047A0E D2 =0000001C D3 =00000000
D4 =00000000 D5 =00000000 D6 =00000000 D7 =00000000
A0 =00000000 A1 =00000000 A2 =00000000 A3 =00000000
A4 =00000000 A5 =00000000 A6 =00000000 A7 =00004000
00007008 66FA BNE.B $7004
332Bug>
TC Trace On Change Of Control Flow TC
3.31 TRACE ON CHANGE OF CONTROL FLOW
TC [<COUNT>]
Use the TC command to start execution at the address in the target PC. Tracing begins at
detection of an instruction that causes a change of control flow, such as Bcc, JSR, BSR, RTS,
etc. Execution is in real time until a change of flow instruction is encountered. The optional
count field specifies the number of change of flow instructions to be traced before returning
control to 332Bug. The optional count field default is 1. Register display printout only occurs
when a change of control flow occurs.
During tracing, breakpoints in ROM or write protected memory are monitored (but not
inserted) for all trace commands which allow the use of breakpoints. Note that the TC
command recognizes a breakpoint only if it is at a change of flow instruction. Control is
returned to 332Bug if a breakpoint with 0 count is encountered. See the trace (T) command
for more details.
The trace functions are implemented with the trace bits (T0, T1) in the MC68332 MCU device
status register. Do not modify the trace bits (T0, T1) while using the trace commands.
Because the trace functions are implemented using the hardware trace bits in the MC68332
MCU, code in ROM can be traced. During trace mode, breakpoints are monitored and their
counts decremented when the corresponding instruction with breakpoint is traced. This
allows breakpoints to work in ROM, but only in the trace mode.
EXAMPLE: (The following program resides at location $7000)
332Bug>MD 7000;DI<CR>
00007000 2200 MOVE.L D0,D1
00007002 4282 CLR.L D2
00007004 D401 ADD.B D1,D2
00007006 E289 LSR.L #$1,D1
00007008 66FA BNE.B $7004
0000700A E20A LSR.B #$1,D2
0000700C 55C2 SCS.B D2
0000700E 60FE BRA.B $700E
332Bug>
Initialize PC and D0:
332Bug>RM PC <CR>
PC =00008000 ? 7000.<CR>
332Bug>RM D0 <CR>
D0 =00000000 ? 8F41C.<CR>
TC Trace On Change Of Control Flow TC
Trace on change of flow:
332Bug>TC<CR>
00007008 66FA BNE.B $7004
PC =00007004 SR =2700=TR:OFF_S_7_..... VBR =00000000
SFC =0=F0 DFC =0=F0 USP =0000382C SSP* =00004000
D0 =0008F41C D1 =00047A0E D2 =0000001C D3 =00000000
D4 =00000000 D5 =00000000 D6 =00000000 D7 =00000000
A0 =00000000 A1 =00000000 A2 =00000000 A3 =00000000
A4 =00000000 A5 =00000000 A6 =00000000 A7 =00004000
00007004 D401 ADD.B D1,D2
332Bug>
Note that the above display also shows the change of flow instruction.
TM Transparent Mode TM
3.32 TRANSPARENT MODE
TM [<PORT>][<ESCAPE>]
The TM command connects the console serial port and the host port together, allowing the
user to communicate with a host computer. A message displayed by TM shows the current
escape character, i.e., the character used to exit the transparent mode. The two ports remain
connected until the escape character is received by the console port. The escape character
is not transmitted to the host and at power up or reset is initialized to $01=^A.
The optional port number allows the user to specify which port is the host port. If the port
number is omitted the default is port 1. The port number must be within the range 0 to $1F.
Ports do not have to have the same baud rate, but for reliable operation the terminal port
baud rate should be equal to or greater than the host port baud rate. Use the PF command
to change baud rates.
The optional escape argument allows the user to specify the exit character. Use one of three
formats:
ascii code : $03 Set escape character to ^C
ascii character : 'c Set escape character to c
control character : ^C Set escape character to ^C
If the port number is omitted and the escape argument is entered as a numeric value,
precede the escape argument with a comma to distinguish it from a port number.
Example 1:
332Bug>TM<CR> Enter TM
Escape character: $01=^ A Exit code is always displayed
<^A> Exit transparent mode
Example 2:
332Bug>TM ^g<CR> Enter TM and set escape character
Escape character: $07=^ G to ^ G
<^G> Exit transparent mode
332Bug>
TT Trace To Temporary Breakpoint TT
3.33 TRACE TO TEMPORARY BREAKPOINT
TT <ADDR>
Use the TT command to set a temporary breakpoint at a specified address and trace until
encountering a 0 count breakpoint. The temporary breakpoint is then removed (TT is
analogous to the GT command) and control is returned to 332Bug. Tracing starts at the
target PC address. As each instruction is traced, a register display printout is generated.
During tracing, breakpoints in ROM or write protected memory are monitored (but not
inserted) for all trace commands which allow the use of breakpoints. Control is returned to
332Bug if a breakpoint with 0 count is encountered. See the trace (T) command for more
details.
The trace functions are implemented with the trace bits (T0, T1) in the MC68332 status
register. Do not modify trace bits (T0, T1) while using the trace commands. Because the
trace functions are implemented using the hardware trace bits in the MC68332 MCU, code in
ROM can be traced. During trace mode, breakpoints are monitored and their counts
decremented when the corresponding instruction with breakpoint is traced. This allows
breakpoints to work in ROM, but only in the trace mode.
EXAMPLE: (The following program resides at location $7000)
332Bug>MD 7000;DI<CR>
00007000 2200 MOVE.L D0,D1
00007002 4282 CLR.L D2
00007004 D401 ADD.B D1,D2
00007006 E289 LSR.L #$1,D1
00007008 66FA BNE.B $7004
0000700A E20A LSR.B #$1,D2
0000700C 55C2 SCS.B D2
0000700E 60FE BRA.B $700E
332Bug>
Initialize PC and D0:
332Bug>RM PC<CR>
PC =00008000 ? 7000.<CR>
332Bug>RM D0<CR>
D0 =00000000 ? 8F41C.<CR>
TT Trace To Temporary Breakpoint TT
Trace to temporary breakpoint:
332Bug>TT 7006<CR>
PC =00007002 SR =2700=TR:OFF_S_7_..... VBR =00000000
SFC =0=F0 DFC =0=F0 USP =0000382C SSP* =00004000
D0 =0008F41C D1 =0008F41C D2 =00100200 D3 =00000000
D4 =00000000 D5 =00000000 D6 =00000000 D7 =00000000
A0 =00000000 A1 =00000000 A2 =00000000 A3 =00000000
A4 =00000000 A5 =00000000 A6 =00000000 A7 =00004000
00007002 4282 CLR.L D2
PC =00007004 SR =2704=TR:OFF_S_7_..Z.. VBR =00000000
SFC =0=F0 DFC =0=F0 USP =0000382C SSP* =00004000
D0 =0008F41C D1 =0008F41C D2 =00000000 D3 =00000000
D4 =00000000 D5 =00000000 D6 =00000000 D7 =00000000
A0 =00000000 A1 =00000000 A2 =00000000 A3 =00000000
A4 =00000000 A5 =00000000 A6 =00000000 A7 =00004000
00007004 D401 ADD.B D1,D2
At Breakpoint
PC =00007006 SR =2700=TR:OFF_S_7_..... VBR =00000000
SFC =0=F0 DFC =0=F0 USP =0000382C SSP* =00004000
D0 =0008F41C D1 =0008F41C D2 =0000001C D3 =00000000
D4 =00000000 D5 =00000000 D6 =00000000 D7 =00000000
A0 =00000000 A1 =00000000 A2 =00000000 A3 =00000000
A4 =00000000 A5 =00000000 A6 =00000000 A7 =00004000
00007006 E289 LSR.L #$1,D1
332Bug>
VE Verify S-Records Against Memory VE
3.34 VERIFY S-RECORDS AGAINST MEMORY
VE [<PORT>][<ADDR>][;<X/-C>][=<text>]
VE is identical to the LO command with the exception that data is not stored to memory but
merely compared to the contents of memory.
The VE command accepts serial data from a host system in the form of a Motorola S-records
file and compares it to data already in memory. If the data does not compare, then the user is
alerted via information sent to the terminal screen.
The optional port number allows the user to specify which is the download port. If the port
number is omitted the default is port 0. The port number must be within the range 0 to $1F.
The BCC default hardware configuration consists of one I/O port; P4 on the BCC or P9 on the
PFB. This limits the user to one host computer running a terminal emulation program. To
send S-records, the user must escape out of the terminal emulation program because the
host computer can not perform terminal emulation and send S-records at the same time.
When the host is not in terminal emulation mode, all status messages from 332Bug would be
lost. Thus the user must press <CR> twice after re-entering the terminal emulation program
to signal 332Bug that status messages can now be sent.
The optional <ADDR> field allows the user to enter an offset address which is added to the
address contained in the record address field. This causes the records to be compared to
memory at different locations than would normally occur. The contents of the automatic offset
register are not added to the S-record addresses. If the address is in the range $0 to $1F and
the port number is omitted, precede the address with a comma to distinguish it from a port
number.
The optional text field, entered after the equals sign (=), is sent to the host before 332Bug
begins to look for S-records at the host port. This allows the user to send a command to the
host device to initiate the download. Do not delimited text with quote marks. The text follows
the equals sign and terminates with a carriage return. If the host is operating full duplex, the
string echoes back to the host port and appears on the user's terminal screen.
Some host systems echo all received characters so the text string is sent to and received
from the host one character at a time. After the entire command is sent to the host, VE looks
for an LF character from the host signifying the end of the echoed command. No data records
are processed until LF is received. If the host system does not echo characters, VE still looks
for an LF character before data records are processed. For this reason it is required in
situations where the host system does not echo characters that the first record transferred by
the host system be a header record. The header record is not used, but the LF after the
header record serves to break VE out of the loop so that data records are processed.
VE Verify S-Records Against Memory VE
Other VE options are:
-C option - Ignore checksum. A checksum for the data contained within an S-Record is
calculated as the S-record is read in at the port. Normally, this calculated
checksum is compared to the checksum contained within the S-Record and
if the compare fails, an error message is sent to the screen. If this option is
selected, the comparison is not made.
X option - Echo. This option echoes the S-records to the user's terminal as they are
read in at the host port. Do not use this option when port 0 is specified.
During a verify operation S-record data is compared to memory. Verification begins with the
address contained in the S-record address field (plus the offset address). If the verification
fails, then the non-comparing record is set aside until the verify is complete and then it is
displayed on the screen. If three non-comparing records are encountered in the course of a
verify operation, then the command is aborted.
If a non-hex character is encountered within the data field, then the received portion of the
record is printed to the screen and 332Bug's error handler points to the faulty character.
An error condition exists if the embedded checksum of a record does not agree with the
checksum calculated by 332Bug. A message is displayed showing the address of the record
(as obtained from the address field of the record), the calculated checksum, and the
checksum read with the record. A copy of the record is also output. This is a fatal error and
causes the command to abort.
EXAMPLES:
This short program was developed on a host system.
1 * Test Program
2 *
3 65004000 ORG $65004000
4
5 65004000 7001 MOVEQ.L #1,D0
6 65004002 D088 ADD.L A0,D0
7 65004004 4A00 TST.B D0
8 65004006 4E75 RTS
9 END
****** TOTAL ERRORS 0--
****** TOTAL WARNINGS 0--
VE Verify S-Records Against Memory VE
Then converted into an S-Record file named TEST.MX as follows:
S00A0000544553542E4D58E2
S30D650040007001D0884A004E7577
S7056500400055
This file was downloaded into memory using "LO -65000000" at address $4000. The
program may be examined in memory using the MD (memory display) command.
332Bug>MD 4000:4;DI<CR>
00004000 7001 MOVEQ.L #$1,D0
00004002 D088 ADD.L A0,D0
00004004 4A00 TST.B D0
00004006 4E75 RTS
332Bug>
To ensure the program has not been destroyed in memory, use the VE command to perform
a verification.
332Bug>VE -65000000<CR>
(blank line as the BCC waits for an
S-record)
Enter the terminal emulator's escape key to return to the host computer's operating system
(ALT-F4 for ProComm). A host command is then entered to send the S-record file to the port
where the BCC is connected (for MS-DOS based host computer this would be "type test.mx
>com1", where the BCC was connected to the com1 port).
After the file has been sent, the user then restarts the terminal emulation program (for MS-
DOS based host computers, enter EXIT at the prompt).
Since the port number equals the current terminal, two <CR>'s are required to signal 332Bug
that verification is complete and the terminal emulation program is ready to receive the status
message.
<CR><CR> (signal verfication complete)
Verify passes.
332Bug>
The verification passes. The program stored in memory was the same as that in the
downloaded S-record file.
VE Verify S-Records Against Memory VE
Now change the program in memory and perform the verification again.
332Bug>M 4002<CR>
00004002 D088 ? D089.<CR>
332Bug>VE -65000000<CR>
(blank line as the BCC waits for an
S-record)
Enter the terminal emulator's escape key to return to the host computer's operating system
(ALT-F4 for ProComm). A host command is then entered to send the S-record file to the port
where the BCC is connected (for MS-DOS based host computer this would be "type test.mx
>com1", where the BCC was connected to the com1 port).
After the file has been sent, the user then restarts the terminal emulation program (for MS-
DOS based host computers, enter EXIT at the prompt).
Since the port number equals the current terminal, two <CR>'s are required to signal 332Bug
that verification is complete and the terminal emulation program is ready to receive the status
message.
<CR><CR> (signal verification completion)
S30D65004000------88--------77 (record did not verify)
332Bug>
The byte which was changed in memory does not compare with the corresponding byte in
the S-record.